<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test"></div>
    <script src="../lib/react.development.js"></script>
  <script src="../lib/react-dom.development.js"></script>
  <script src="../lib/babel.min.js"></script>
  <script type="text/babel">
      class MyComponent extends React.Component{
          constructor(props){//类中的构造器在开发中用不到
            //他有以下作用:1.初始化state，2.处理事件函数来绑定实例
            //但是以上两种方法多有简写方式且不依赖于构造器，而且传递的props也可以render函数里面访问到
            //所以构造器用不上
              super()
              console.log(props)
          }
          render(){
          return <h2>fiwaove</h2>
          }
      }
      ReactDOM.render(<MyComponent age='21432'/>,document.getElementById('test'))
      </script>
</body>
</html>